
gwtBookmarklet= {};

gwtBookmarklet.jsHref;

gwtBookmarklet.gecko='gecko1_8';
gwtBookmarklet.gecko1_8='gecko1_8';
gwtBookmarklet.opera='opera';
gwtBookmarklet.safari='safari';
gwtBookmarklet.ie6='ie6';
gwtBookmarklet.ie8='ie8';
gwtBookmarklet.ie9='ie9';

//reporsitory address for your  compiled codes
//gwtBookmarklet.baseLocation="http://transletco.appspot.com/generated/";
gwtBookmarklet.baseLocation="http://translet-co.googlecode.com/svn/trunk/TransletCO_0.0.2/war/generated/";


gwtBookmarklet.loadJsFile=function(filename, scriptId){
   var fileref=document.createElement('script')
   fileref.setAttribute("type","text/javascript");
   fileref.setAttribute("src", filename);
   fileref.setAttribute("id", scriptId);
  if (typeof fileref!="undefined")
   document.getElementsByTagName("head")[0].appendChild(fileref)
};


gwtBookmarklet.detectBrowser=function(){
	var ua = navigator.userAgent.toLowerCase();
    var makeVersion = function(result){
      return parseInt(result[1]) * 1000 + parseInt(result[2]);
    }
    ;
    if (function(){
      return ua.indexOf('opera') != -1;
    }
    ())
      return gwtBookmarklet.opera;
    if (function(){
      return ua.indexOf('webkit') != -1;
    }
    ())
      return gwtBookmarklet.safari;
    if (function(){
      return ua.indexOf('msie') != -1 && $doc_0.documentMode >= 9;
    }
    ())
      return gwtBookmarklet.ie9;
    if (function(){
      return ua.indexOf('msie') != -1 && $doc_0.documentMode >= 8;
    }
    ())
      return gwtBookmarklet.ie8;
    if (function(){
      var result = /msie ([0-9]+)\.([0-9]+)/.exec(ua);
      if (result && result.length == 3)
        return makeVersion(result) >= 6000;
    }
    ())
      return gwtBookmarklet.ie6;
    if (function(){
      return ua.indexOf('gecko') != -1;
    }
    ())
      return gwtBookmarklet.gecko1_8;
    return gwtBookmarklet.gecko;
  };
  
gwtBookmarklet.init = function() {
	if(window.location.href.indexOf("https://")!= -1 ){
		gwtBookmarklet.baseLocation="https://translet-co.googlecode.com/svn/trunk/TransletCO_0.0.2/war/generated/";
	}
 gwtBookmarklet.jsHref=gwtBookmarklet.baseLocation+gwtBookmarklet.detectBrowser()+".cache.html";
 gwtBookmarklet.loadJsFile(gwtBookmarklet.jsHref,"transletcoscriptGWT");
};

gwtBookmarklet.init();